//
//  UIImage+LLAnimatedImages.m
//  live.ly
//
//  Created by bob on 16/7/2.
//  Copyright © 2016年 musical.ly. All rights reserved.
//


@implementation UIImage (LLAnimatedImages)

+ (UIImage *)networkTrafficAnimatedImage
{
    NSMutableArray *arr = [@[] mutableCopy];
    for (int i = 0; i <= 23; i++) {
        [arr addObject:[UIImage imageNamed:[NSString stringWithFormat:@"ll-traffic-control-animation_%d", i]]];
    }
    for (int i = 0; i < 400; i++) {
        [arr addObject:[UIImage imageNamed:[NSString stringWithFormat:@"ll-traffic-control-animation_%d", i % 2 == 0 ? 22 : 23]]];
    }
    return [UIImage animatedImageWithImages:arr duration:arr.count * 0.1];
}

+ (UIImage *)blinkingEyeIconAnimatedImage
{
    NSMutableArray *arr = [@[] mutableCopy];
    //    for (int i = 0; i < 40; i++)
    //    {
    //
    //    }
    [arr addObject:[UIImage imageNamed:@"ll-camera-eye-icon0"]];
    [arr addObject:[UIImage imageNamed:@"ll-camera-eye-icon1"]];
    [arr addObject:[UIImage imageNamed:@"ll-camera-eye-icon2"]];
    [arr addObject:[UIImage imageNamed:@"ll-camera-eye-icon3"]];
    return [UIImage animatedImageWithImages:arr duration:4 * arr.count];
}

+ (UIImage *)inviteFriendsAnimatedImage
{
    NSMutableArray *arr = [@[] mutableCopy];
    for (int i = 0; i <= 33; i++) {
        [arr addObject:[UIImage imageNamed:@"ll-invite-0"]];
    }
    [arr addObject:[UIImage imageNamed:@"ll-invite-1"]];
    [arr addObject:[UIImage imageNamed:@"ll-invite-2"]];
    [arr addObject:[UIImage imageNamed:@"ll-invite-3"]];
    [arr addObject:[UIImage imageNamed:@"ll-invite-4"]];
    [arr addObject:[UIImage imageNamed:@"ll-invite-5"]];
    [arr addObject:[UIImage imageNamed:@"ll-invite-6"]];
    return [UIImage animatedImageWithImages:arr duration:0.033 * arr.count];
}

+ (UIImage *)partyInviteFriendsAnimatedImage
{
    NSMutableArray *arr = [@[] mutableCopy];
    for (int i = 0; i <= 33; i++) {
        [arr addObject:[UIImage imageNamed:@"ll-pinvite-0"]];
    }
    [arr addObject:[UIImage imageNamed:@"ll-pinvite-1"]];
    [arr addObject:[UIImage imageNamed:@"ll-pinvite-2"]];
    [arr addObject:[UIImage imageNamed:@"ll-pinvite-3"]];
    [arr addObject:[UIImage imageNamed:@"ll-pinvite-4"]];
    [arr addObject:[UIImage imageNamed:@"ll-pinvite-5"]];
    [arr addObject:[UIImage imageNamed:@"ll-pinvite-6"]];
    return [UIImage animatedImageWithImages:arr duration:0.033 * arr.count];
}

+ (UIImage *)videoGuestLoadingAnimatedImage
{
    NSMutableArray *arr = [@[] mutableCopy];
    for (int i = 1; i <= 12; i++) {
        [arr addObject:[UIImage imageNamed:[NSString stringWithFormat:@"ll-vg-loading%d", i]]];
    }
    return [UIImage animatedImageWithImages:arr duration:arr.count * 0.1];
}

+ (UIImage *)audienceGuestRequestAnimatedImage
{
    NSMutableArray *arr = [@[] mutableCopy];
    [arr addObject:[UIImage imageNamed:@"ll-audience-request-1"]];
    [arr addObject:[UIImage imageNamed:@"ll-audience-request-2"]];
    [arr addObject:[UIImage imageNamed:@"ll-audience-request-3"]];
    return [UIImage animatedImageWithImages:arr duration:1];
}

@end
